<?php

namespace App\Libs\Company\SheetTemplateHandler\Report;

class Template112 extends AbstractTemplate
{
    public $rules = [
        'column' => [
        ],
        'cell' => [
            'rule' => [
                ['row' => 6, 'column' => 2, 'vt' => 5, 'vt_val' => ['SUM', [[7, 2], [8, 2]]]],
                ['row' => 7, 'column' => 2, 'vt' => 1],
                ['row' => 8, 'column' => 2, 'vt' => 1],
                ['row' => 9, 'column' => 2, 'vt' => 5, 'vt_val' => ['SUM', [[10, 2], [11, 2]]]],
                ['row' => 10, 'column' => 2, 'vt' => 2],
                ['row' => 11, 'column' => 2, 'vt' => 2],
            ]
        ],
        'dict' => [
        ],
    ];

    public function generateReport()
    {
        $this->renderHeader();
        $this->output['sheets']['sheet-01']['cellData']['4']['0']['v'] = '填报单位：' . $this->subTask->district->name;
        $this->output['sheets']['sheet-01']['cellData']['4']['3']['v'] = '统计周期：' . date($this->subTask->task->year . '年' . $this->subTask->task->key . '月');
        return $this->output;
    }
}
